﻿using System;
using System.Windows;

namespace WpfApplication2
{
    class myWPFApp: Application
    {
        [STAThread]
        static void Main(string[] args)
        {
            myWPFApp app = new myWPFApp();

            app.Startup += AppStartUp;
            app.Exit += AppExit;
            app.Run();
        }



        static void AppStartUp(object sender, StartupEventArgs e)
        {
            Window mainWin = new Window();
            mainWin.Title = "MyFirstWPF";
            mainWin.Height = 200;
            mainWin.Width = 300;
            mainWin.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            mainWin.ShowDialog();
        }

        static void AppExit(object sender, ExitEventArgs e) 
        {
            MessageBox.Show("Exit App");
        }
    }
}
